﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sys1a10
    {
		private string _pagename;
		private string _pageid;
		private string _reportname;
		private string _listid;
		private string _ispublic;
		private string _comcode;
		
        /// <summary>
        /// 页面编码
        /// </summary>
		public string Pagename
		{
			get { return _pagename;	 }
			set { _pagename=value;	}
		}
        /// <summary>
        /// 纸张ID
        /// </summary>
		public string Pageid
		{
			get { return _pageid;	 }
			set { _pageid=value;	}
		}
        /// <summary>
        /// 对应的报表
        /// </summary>
		public string Reportname
		{
			get { return _reportname;	 }
			set { _reportname=value;	}
		}
        /// <summary>
        /// 内码
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
        /// <summary>
        /// 是否公用
        /// </summary>
		public string Ispublic
		{
			get { return _ispublic;	 }
			set { _ispublic=value;	}
		}
        /// <summary>
        /// 公司标识
        /// </summary>
		public string Comcode
		{
			get { return _comcode;	 }
			set { _comcode=value;	}
		}
		
		public static List<Sys1a10> GetSys1a10ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sys1a10> list = new List<Sys1a10>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sys1a10 model = GetSys1a10ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sys1a10 GetSys1a10ByDataRow(DataRow dr)
		{
			Sys1a10 model = new Sys1a10(); //实例化Sys1a10
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("pagename")&&!(dr["pagename"] is System.DBNull))  
				model.Pagename = ( string)dr["pagename"];
			if (dcc.Contains("pageid")&&!(dr["pageid"] is System.DBNull))  
				model.Pageid = ( string)dr["pageid"];
			if (dcc.Contains("reportname")&&!(dr["reportname"] is System.DBNull))  
				model.Reportname = ( string)dr["reportname"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			if (dcc.Contains("ispublic")&&!(dr["ispublic"] is System.DBNull))  
				model.Ispublic = ( string)dr["ispublic"];
			if (dcc.Contains("comcode")&&!(dr["comcode"] is System.DBNull))  
				model.Comcode = ( string)dr["comcode"];
			
			return model;
		}
    }
}
